//
//  HomeSearchSectionView.m
//  ReceiptDelivery
//
//  Created by 吕晶 on 2020/11/17.
//  Copyright © 2020 吕晶. All rights reserved.
//

#import "HomeSearchSectionView.h"

@interface HomeSearchSectionView ()

@property (nonatomic, strong) UILabel *titleLab;

@end

@implementation HomeSearchSectionView

+ (instancetype)HomeSearchSectionViewWithViewOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath withIdentifier:(NSString *)identifier withCollectionView:(UICollectionView *)collectionView {
    HomeSearchSectionView *headView = [collectionView dequeueReusableSupplementaryViewOfKind:kind withReuseIdentifier:identifier forIndexPath:indexPath];
    if (headView == nil) {
        headView = [HomeSearchSectionView new];
    }
    return headView;
}

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        self.backgroundColor = [UIColor whiteColor];
        CGFloat titleW = ScreenW * 0.5;
        CGFloat titleH = 15;
        CGFloat titleX = 23;
        CGFloat titleY = 15;
        _titleLab = [[UILabel alloc] initWithFrame:CGRectMake(titleX, titleY, titleW, titleH)];
        _titleLab.textColor = HexColor(0x2B2C44);
        _titleLab.font = BoldFontOfSize(14);
        _titleLab.textAlignment = NSTextAlignmentLeft;
        [self addSubview:_titleLab];
        
        _size = CGSizeMake(ScreenW, _titleLab.nim_bottom + titleY);
    }
    return self;
}

-(void)setTitleStr:(NSString *)titleStr {
    _titleStr = titleStr;
    self.titleLab.text = titleStr;
}

@end
